// 引入端口
const express = require('express');
// 引入ajax路由
const pro = require('./router/pro.js');
const laptop = require('./router/laptop.js');
const cart = require('./router/cart.js');
const order = require('./router/order.js');
const address = require('./router/address.js');
// 创建web服务器
const app = express();
// 创建端口
app.listen(8080);
// 托管用户静态文件夹
app.use(express.static('./pro/user'));
// 引入body-parser 解析模块
const bodyParser = require('body-parser');
// 将收到的post请求的数据解析为对象
app.use(bodyParser.urlencoded({
	extended:false
}));





//挂载路由
app.use('/pro',pro);
app.use('/laptop',laptop);
app.use('/cart',cart);
app.use('/order',order);
app.use('/address',address);